;;;; Created on 2011-04-28 13:29:41
;12.4
;a
(defstruct node
  (name nil)
  (question nil)
  (yes-case nil)
  (no-case nil)
  )

;b
(setf *node-list* nil)

(defun init ()
  (setf *node-list* nil)
  )

;c
(defun add-node (nd)
  (setf *node-list* (append *node-list* (list nd)))
  (node-name nd)
  )

;d
(defun find-node (nn)
  (doitems (n *node-list* nil)
           (when (equal (node-name nn) (node-name n)) return n)
           )
  )

;e
(defun process-node (nn q)
  (let ((n (find-node nn)))
    (if (null n) (and "node not defined" nil)
        (and (node-question nn) (if (q) (node-yes-case nn)
            (node-no-case nn)))
        )
    )
  )

;f
;(defun run ()
;  (let ((current-node 'START)))
;  )